package njust.csc.aecore.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * @Author ZhouHang
 * @Date 24/6/6 周四
 */
@Serializable
data class QWenRequestBody (
    var model: String,
    var input: QWenInput,
    var parameters: QWenParameter
)

@Serializable
data class QWenInput (
    var messages: List<Message>,
)

@Serializable
data class QWenParameter (
    var result_format: String? = null,
    var max_tokens: Int? = null
)

@Serializable
data class ZZZRequestBody(
    var model: String,
    var messages: List<Message>
)

@Serializable
data class QWenResponse(
    val output: QWenOutput,
    val usage: QWenUsage,
    val request_id: String
)

@Serializable
data class QWenOutput (
    val choices: List<QWenChoice>,
)

@Serializable
data class QWenChoice (
    val finish_reason: String,
    val message: Message
)

@Serializable
data class QWenUsage (
    val total_tokens: Int,
    val output_tokens: Int,
    val input_tokens: Int
)

@Serializable
enum class Role {
    @SerialName("system")
    SYSTEM,
    @SerialName("user")
    USER,
    @SerialName("assistant")
    ASSISTANT,
    @SerialName("tool")
    TOOL,
}

@Serializable
data class Message (
    var role: Role,
    var content: String
)

@Serializable
data class ZZZResponse (
    val id: String,
    val `object`: String,
    val created: Int,
    val model: String,
    val choices: List<ZZZChoice>,
    val usage: ZZZUsage,
    val system_fingerprint: String?,
    val code: Int,
    val msg: String
)

@Serializable
data class ZZZChoice (
    val index: Int,
    val message: Message,
    val logprobs: String?,
    val finish_reason: String
)

@Serializable
data class ZZZUsage (
    val prompt_tokens: Int,
    val completion_tokens: Int,
    val total_tokens: Int
)
